/* 
 ********************************************************************
 * Project:     
 * File:    	peripherals_config.h
 *
 * System:   	ARM7TDMI-S 32 Bit
 * Compiler:  	GCC 4.0.3
 *
 * Date:      	2006-08-31
 * Author:    	Wenz
 *
 * Rights:    	Hitex Development Tools GmbH
 *            	Greschbachstr. 12
 *            	D-76229 Karlsruhe
 ********************************************************************
 * Description:
 *	
 * configuration settings for the peripheral modules.
 * currently available
 *      - timer
 *      - EMAC 
 ********************************************************************
 * History:
 *
 *  Revision 1.0    2006/09/27      We
 *     Initial revision 
 ********************************************************************
 * This software is provided by the author 'AS IS' without any 
 * warranties. Hitex Development Tools GmbH shall not be held 
 * liable for any direct, indirect or consequential damages with
 * respect to any claims arising from the content of such software.
 ********************************************************************/


#ifndef _CONFIG_H_
#define _CONFIG_H_


#include "defines.h"


/*
 **********************************************************************
 * 
 *	configure timer modules for counters
 *	timer 0 is used for system tick 
 * 
 **********************************************************************/

#define USE_TIMER_0		1

/* define time tick for system timer in ms */

#define	TIMER_0_TICK	1		// timer in ms 



/*
 **********************************************************************
 * 
 * configuration of the ethernet module 
 * 
 **********************************************************************/

#define	USE_ETHERNET	1


/* define SA0 .. SA5 MAC-Address			*/

#define SA0		0x00
#define SA1		0x30
#define SA2		0x6C
#define SA3		0x91
#define SA4		0x0F
#define SA5		0x01


/*
 **********************************************************************
 * specify the MII Interface
 *	 
 *	note: 	144 PIN derivatives support only a reduced MII Interface so 
 *			208 PIN derivatives a complete MII Interface
 *			configure this Bit accordingly  		   
 *	
 *	0:	MII Interface
 * 	1: 	RMII Interface
 **********************************************************************/

#define RMII_INTERFACE	1

/*
 **********************************************************************
 * specify the data fragments 
 *	 
 *	note: 	guarantee that enough space is available for at least one 
 *			complete frame. Thre driver copies a received frame out of 
 *			driver memory, not each fragment.  		   
 *
 *			The MAXLENGTH for receive or transmit should not exeed 
 *			the ETH_MAX_FLEN which defines the maximum length of a 
 *			fragment which the hardware can transmit.
 *
 **********************************************************************/

#define NUMBER_REC_FRAGMENTS		6
#define MAXLENGTH_REC_FRAGMENT		1536	
#define MAXLENGTH_REC_FRAME			(NUMBER_REC_FRAGMENTS-1) * MAXLENGTH_REC_FRAGMENT

#define NUMBER_TX_FRAGMENTS			2
#define MAXLENGTH_TX_FRAGMENT		1536   	


/* don't change this setting, because the driver does not support 
 * sending fragments							
*/
#define MAXLENGTH_TX_FRAME			MAXLENGTH_TX_FRAGMENT	


/*
 **********************************************************************
 * configure the start address in RAM area, where the ethernet data  
 * including descriptor pointers could be stored.
 *
 *	the address has to be 8 - byte aligned.
 *
 * note:	It should be necessary that enough space is available. If 
 *			the address is not configured to reserved 16K ethernet RAM,
 *			take care that userdata required by application does not 
 *			overwrite data used by ethernet DMA.
 **********************************************************************/

#define ETHDATA_STARTADDRESS		0x7FE00000	/* ETH RAM 16K */

 
 
 
 /*
 **********************************************************************
 *
 * configure the external PHY 
 *
 **********************************************************************/

/*
 **********************************************************************
 *
 * if loopback is selected, PHYSPEED will not be 
 * taken into account	
 **********************************************************************/

#define LOOPBACK					FALSE

/*
 **********************************************************************
 *
 * define speed, duplex mode and the link setup method.
 *
 **********************************************************************/

typedef enum
{
	AUTONEGOTIATION,
	FDX_100,
	FDX_10,
	HDX_100,
	HDX_10
}
phybasicmode;


#define PHYSPEED					AUTONEGOTIATION //AUTONEGOTIATION

/*
 **********************************************************************
 *
 * define receive filtering
 *
 **********************************************************************/


#define ACCEPTUNICAST				TRUE
#define ACCEPTBROADCAST				TRUE
#define ACCEPTMULTICAST				TRUE

#define ACCEPTUNICASTHASH			FALSE
#define ACCEPTMULTICASTHASH			FALSE

#define ACCEPTPERFECT				TRUE

#define MAGICPACKETWOL				FALSE
#define RXFILTERWOL					FALSE

/*
 **********************************************************************
 * define system paramters
 **********************************************************************/

/* define the priority for the ethernet interrupt   */
/* value: 0 .. 15   0 has highest prio              */
#define INT_PRIORITY                2


#endif	// CONFIG_H 
